package cn.itcast.user.config;

import cn.itcast.user.client.UserClientFallback;
import feign.Logger;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@EnableFeignClients(basePackages = "cn.itcast.user.client")
@Configuration
public class FeignConfig {
    @Bean
    Logger.Level feignLoggerLevel(){
        return Logger.Level.FULL;
    }

    @Bean
    @ConditionalOnMissingBean
    public UserClientFallback userClientFallback(){
        return new UserClientFallback();
    }
}